home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / misc / dspice0s / newnod.c < prev    next >
C/C++ Source or Header  |  1992-11-21  |  5KB  |  147 lines

  1. /* newnod.f -- translated by f2c (version of 3 February 1990  3:36:42).
  2.    You must link the resulting object file with the libraries:
  3.     -lF77 -lI77 -lm -lc   (in that order)
  4. */
  5.  
  6. #include "f2c.h"
  7.  
  8. /* Common Block Declarations */
  9.  
  10. struct {
  11.     integer ielmnt, isbckt, nsbckt, iunsat, nunsat, itemps, numtem, isens, 
  12.         nsens, ifour, nfour, ifield, icode, idelim, icolum, insize, 
  13.         junode, lsbkpt, numbkp, iorder, jmnode, iur, iuc, ilc, ilr, 
  14.         numoff, isr, nmoffc, iseq, iseq1, neqn, nodevs, ndiag, iswap, 
  15.         iequa, macins, lvnim1, lx0, lvn, lynl, lyu, lyl, lx1, lx2, lx3, 
  16.         lx4, lx5, lx6, lx7, ld0, ld1, ltd, imynl, imvn, lcvn, nsnod, 
  17.         nsmat, nsval, icnod, icmat, icval, loutpt, lpol, lzer, irswpf, 
  18.         irswpr, icswpf, icswpr, irpt, jcpt, irowno, jcolno, nttbr, nttar, 
  19.         lvntmp;
  20. } tabinf_;
  21.  
  22. #define tabinf_1 tabinf_
  23.  
  24. struct {
  25.     integer locate[50], jelcnt[50], nunods, ncnods, numnod, nstop, nut, nlt, 
  26.         nxtrm, ndist, ntlin, ibr, numvs, numalt, numcyc;
  27. } cirdat_;
  28.  
  29. #define cirdat_1 cirdat_
  30.  
  31. struct {
  32.     doublereal value[200000];
  33. } blank_;
  34.  
  35. #define blank_1 blank_
  36.  
  37. /* Table of constant values */
  38.  
  39. static integer c__1 = 1;
  40.  
  41. /*<       subroutine newnod(nodold,nodnew,inodx,inodi,nnodi) >*/
  42. /* Subroutine */ int newnod_(nodold, nodnew, inodx, inodi, nnodi)
  43. integer *nodold, *nodnew, *inodx, *inodi, *nnodi;
  44. {
  45.     /* System generated locals */
  46.     integer i_1;
  47.  
  48.     /* Local variables */
  49.     static integer i, jnodi, jnodx;
  50. #define nodplc ((integer *)&blank_1)
  51. #define cvalue ((complex *)&blank_1)
  52.     extern /* Subroutine */ int extmem_();
  53.  
  54.     /* Parameter adjustments */
  55.     --inodx;
  56.     --inodi;
  57.  
  58.     /* Function Body */
  59. /*<       implicit double precision (a-h,o-z) >*/
  60.  
  61. /*     this routine makes a new node number for an element which is about 
  62. */
  63. /* to be added to the circuit as a result of a subcircuit call. */
  64.  
  65. /* spice version 2g.6  sccsid=tabinf 3/15/83 */
  66. /*<       common /tabinf/ ielmnt,isbckt,nsbckt,iunsat,nunsat,itemps,numtem, >*/
  67. /*<      1   isens,nsens,ifour,nfour,ifield,icode,idelim,icolum,insize, >*/
  68. /*<      2   junode,lsbkpt,numbkp,iorder,jmnode,iur,iuc,ilc,ilr,numoff,isr, >*/
  69. /*<      3   nmoffc,iseq,iseq1,neqn,nodevs,ndiag,iswap,iequa,macins,lvnim1, >*/
  70. /*<      4   lx0,lvn,lynl,lyu,lyl,lx1,lx2,lx3,lx4,lx5,lx6,lx7,ld0,ld1,ltd, >*/
  71. /*<      5   imynl,imvn,lcvn,nsnod,nsmat,nsval,icnod,icmat,icval, >*/
  72. /*<      6   loutpt,lpol,lzer,irswpf,irswpr,icswpf,icswpr,irpt,jcpt, >*/
  73. /*<      7   irowno,jcolno,nttbr,nttar,lvntmp >*/
  74. /* spice version 2g.6  sccsid=cirdat 3/15/83 */
  75. /*<       common /cirdat/ locate(50),jelcnt(50),nunods,ncnods,numnod,nstop, >*/
  76. /*<      1   nut,nlt,nxtrm,ndist,ntlin,ibr,numvs,numalt,numcyc >*/
  77. /* spice version 2g.6  sccsid=blank 3/15/83 */
  78. /*<       common /blank/ value(200000) >*/
  79. /*<       integer nodplc(64) >*/
  80. /*<       complex cvalue(32) >*/
  81. /*<       equivalence (value(1),nodplc(1),cvalue(1)) >*/
  82.  
  83. /* ... inodx, inodi are arrays (see subckt) */
  84. /*<       dimension inodx(1),inodi(1) >*/
  85.  
  86. /*<       if (nodold.ne.0) go to 5 >*/
  87.     if (*nodold != 0) {
  88.     goto L5;
  89.     }
  90. /*<       nodnew=1 >*/
  91.     *nodnew = 1;
  92. /*<       go to 20 >*/
  93.     goto L20;
  94. /*<     5 do 10 i=1,nnodi >*/
  95. L5:
  96.     i_1 = *nnodi;
  97.     for (i = 1; i <= i_1; ++i) {
  98. /*<       jnodx=inodx(1) >*/
  99.     jnodx = inodx[1];
  100. /*<       if (nodold.ne.nodplc(jnodx+i)) go to 10 >*/
  101.     if (*nodold != nodplc[jnodx + i - 1]) {
  102.         goto L10;
  103.     }
  104. /*<       jnodi=inodi(1) >*/
  105.     jnodi = inodi[1];
  106. /*<       nodnew=nodplc(jnodi+i) >*/
  107.     *nodnew = nodplc[jnodi + i - 1];
  108. /*<       go to 20 >*/
  109.     goto L20;
  110. /*<    10 continue >*/
  111. L10:
  112.     ;}
  113.  
  114. /*<       call extmem(inodx(1),1) >*/
  115.     extmem_(&inodx[1], &c__1);
  116. /*<       call extmem(inodi(1),1) >*/
  117.     extmem_(&inodi[1], &c__1);
  118. /*<       call extmem(junode,1) >*/
  119.     extmem_(&tabinf_1.junode, &c__1);
  120. /*<       nnodi=nnodi+1 >*/
  121.     ++(*nnodi);
  122. /*<       ncnods=ncnods+1 >*/
  123.     ++cirdat_1.ncnods;
  124. /*<       jnodx=inodx(1) >*/
  125.     jnodx = inodx[1];
  126. /*<       nodplc(jnodx+nnodi)=nodold >*/
  127.     nodplc[jnodx + *nnodi - 1] = *nodold;
  128. /*<       jnodi=inodi(1) >*/
  129.     jnodi = inodi[1];
  130. /*<       nodplc(jnodi+nnodi)=ncnods >*/
  131.     nodplc[jnodi + *nnodi - 1] = cirdat_1.ncnods;
  132. /*<       nodplc(junode+ncnods)=nodplc(junode+ncnods-1)+1 >*/
  133.     nodplc[tabinf_1.junode + cirdat_1.ncnods - 1] = nodplc[tabinf_1.junode + 
  134.         cirdat_1.ncnods - 2] + 1;
  135. /*<       nodnew=ncnods >*/
  136.     *nodnew = cirdat_1.ncnods;
  137. /*<    20 return >*/
  138. L20:
  139.     return 0;
  140. /*<       end >*/
  141. } /* newnod_ */
  142.  
  143. #undef cvalue
  144. #undef nodplc
  145.  
  146.  
  147.